home *** CD-ROM | disk | FTP | other *** search
- Path: news.iag.net!news
- From: jatmon@iag.net (John R Buchan)
- Newsgroups: comp.lang.c
- Subject: Re: memory allocation in Visual C++
- Date: 10 Jan 1996 14:46:32 GMT
- Organization: Internet Access Group, Orlando, Florida
- Message-ID: <4d0jg8$7aq@news.iag.net>
- References: <4cvds8$4pt@news.ust.hk>
- NNTP-Posting-Host: pm1-orl23.iag.net
- X-Newsreader: WinVN 0.99.7
-
- In article <4cvds8$4pt@news.ust.hk>, ee_ckmaa@uxmail.ust.hk says...
- >
- >I'm writting a program which deals with a large amount of data. It's a
- >16 bit program. Why I cannot allocate automatic arrays in a
- >function as local variables which in total occupies more than 64k? I've set
- the
- >memory model to "large" , though.
- >
- >i.e.
- >
- >main() {
- >
- > float a[88][88]; <----- each of them below 64k; but total of 3 is
- > float b[88][88]; <----- larger than 64k .
- <snip>
-
- Most likely because automatics are commonly put on the stack or in a similar
- predefined area. Look into making them static (use the static specifier
- or make them global) or dynamic (malloc them on need <a little tricky,
- but the c.l.c faq list explains how>). You should look into the problems
- of far pointers when crossing a segment boundary. You may need to use huge.
-
- You should probably read through the c.l.c faq list. It is available for
- anonymous ftp from rtfm.mit.edu /pub/usenet/comp.lang.c.
-
- --
- John R Buchan -:|:- Looking for that elusive FAQ? ftp to:
- jatmon@mail.iag.net -:|:- rtfm.mit.edu /pub/usenet-by-group/....
-
-